package priv.pattern.Mediatorpattern;

import priv.pattern.Mediatorpattern.service.impl.*;

/*
 * 作者：m鹏h
 * 时间；2024/8/11 11:06
 * 描述：中介者模式 客户端
 **/
public class MediatorpatternTest {
    public static void main(String[] args) {
        QQManager qqManager = new QQManager();
        A a = new A();
        B b = new B();
        C c = new C();
        D d = new D();
        qqManager.addUser(a);
        qqManager.addUser(b);
        qqManager.addUser(c);
        qqManager.addUser(d);

        System.out.println("群发消息");
        qqManager.setAllMessage(a, "hello");
        System.out.println("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
        qqManager.setMessage(a, b, "干嘛呢？？");
        qqManager.setMessage(b, a, "上班呢");

    }
}
